package com.ysd.houtaiservlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.ysd.dao.impl.pwdSqlDao;
import com.ysd.util.BaseServlet;
import com.ysd.util.Result;

/**
 * Servlet implementation class pwdsqlServlet
 */
@WebServlet("/pwdsqlServlet")
public class pwdsqlServlet extends BaseServlet {
		pwdSqlDao hdao=new pwdSqlDao();
		public void update(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
		
		
		PrintWriter out=response.getWriter();
		
		String name=request.getParameter("name").toString();
		
		String pwd=request.getParameter("pwd").toString();
		
		int i=hdao.update(name,pwd);
		
		Gson g=new Gson();
		Result res=new Result(200, "true", i, "succes");
		out.print(g.toJson(res));
		out.flush();
		out.close();

	}
}
